<?php
    require 'conn.php';
    session_start();
    // require 'search.php';
    // $search_content='立城1-100';
    // $search_content=$GLOBALS['search_content'];
    $search_content=$_SESSION['val'];
   
    $buil=mb_substr($search_content,0,2,'utf-8');
    if($buil=='立诚'){
        $buil='LC';
    }
    elseif($buil=='知明'){
        $buil='ZM';
    }
    elseif($buil=='笃行'){
        $buil='XD';
    }
    elseif($buil=='致广'){
        $buil='ZG';
    }
    $num=substr($search_content,6);
    // echo $buil;
    // echo $num;
    $sql = "select * from classes where Building='$buil' and Classes='$num'";
    $result = $con->query($sql); 
    // global $a;
    $a = array();
    while($row = $result->fetch_assoc()) { 
        $count=count($row);
        for($i=0;$i<$count;$i++){ 
          unset($row[$i]);
        } 
        array_push($a,$row); 
        
    } 
    // var_dump($a);
?>
